﻿
@{
    ViewData["Title"] = "商户认证信息";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model EasyToHelp.Entity.MerchantInfo
<style>
    .imageup {
        width: 100px;
        height: 36px;
        line-height: 36px;
    }

    .button {
        width: 100px;
        height: 50px;
        line-height: 50px;
    }
</style>
<link href="/Uploader/Uploader6.1.css" rel="stylesheet" />
<script src="/Uploader/Uploader6.1.js"></script>
<script src="/js/MerchantInfo.js"></script>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">商户认证信息</h1>
</header>
<div class="mui-content">
    <div style="padding: 10px 10px;">
        <div id="segmentedControl" class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-negative">
            <a class="mui-control-item mui-active" href="#item1">基本信息</a>
            <a class="mui-control-item" href="#item2">身份证信息</a>
            @*<a class="mui-control-item" href="#item3">店铺信息</a>*@
            <a class="mui-control-item" href="#item4">营业执照信息</a>
        </div>
    </div>
    <div>
        <div id="item1" class="mui-control-content mui-active">
            <form class="mui-input-group">
                <input type="hidden" id="MerchantId" name="MerchantId" value="@(Model == null?0:Model.Id)" />
                <div class="mui-input-row">
                    <label>商户姓名</label>
                    <input type="text" id="Name" name="Name" class="mui-input-clear" value="@(Model == null?"":Model.Name)" placeholder="请输入商户姓名">
                </div>
                <div class="mui-input-row">
                    <label>生日</label>
                    <input type="date" id="Birthday" name="Birthday" class="mui-input-clear" value="@(Model == null?"":Model.Birthday.ToString("yyyy-MM-dd"))" placeholder="生日">
                </div>
                <div class="mui-input-row">
                    <label>联系方式</label>
                    <input type="text" id="Mobile" name="Mobile" class="mui-input-clear" value="@(Model == null?"":Model.Mobile)" placeholder="请输入联系方式">
                </div>
                <div class="mui-input-row">
                    <label>住址</label>
                    <input type="text" id="Address" name="Address" class="mui-input-clear" value="@(Model == null?"":Model.Address)" placeholder="请输入联系住址">
                </div>
                <div class="mui-button-row">
                    <button type="button" class="mui-btn mui-btn-primary" onclick="EditMerchant()">确认</button>&nbsp;&nbsp;
                    <button type="button" class="mui-btn mui-btn-danger" onclick="return false;">取消</button>
                </div>
            </form>
        </div>
        <div id="item2" class="mui-control-content">
            <div class="mui-content-padded">
                <h5>姓名</h5>
                <div class="mui-input-row">
                    <input id="RealName" name="RealName" type="text" class="mui-input-clear" placeholder="请输入商户姓名" value="@(Model == null?"":Model.CardInfo==null?"":Model.CardInfo.RealName)">
                </div>
                <h5>身份证号</h5>
                <div class="mui-input-row">
                    <input id="CardNo" name="CardNo" type="text" class="mui-input-clear" placeholder="请输入商户身份证号" value="@(Model == null?"":Model.CardInfo==null?"":Model.CardInfo.CardNo)">
                </div>
                <h5>正面</h5>
                <div class="mui-input-row">
                    <button onclick="captureImage()">拍照</button>
                    <div class="uploader uploader-default" id="uploadPositive">
                    </div>
                </div>
                <h5>正面预览</h5>
                <div class="mui-input-row mui-card-content">
                    @if (Model == null)
                    {
                        <img id="PreviewPositive" src='/images/zanwu.jpg' height="150" width="100%">
                    }
                    else
                    {
                        <img id="PreviewPositive" src="@(Model == null?"":Model.CardInfo==null?"/images/timg.jpg":Model.CardInfo.Positive)" height="150" width="100%">
                    }
                </div>
                <h5>反面</h5>
                <div class="mui-input-row">
                    <div class="uploader uploader-default" id="uploadReverse">
                    </div>
                </div>
                <h5>反面预览</h5>
                <div class="mui-input-row mui-card-content">
                    @if (Model == null)
                    {
                        <img id="PreviewReverse" src='/images/zanwu.jpg' height="150" width="100%">
                    }
                    else
                    {
                        <img id="PreviewReverse" src="@(Model == null?"":Model.CardInfo==null?"/images/timg.jpg":Model.CardInfo.Opposite)" height="150" width="100%">
                    }
                </div>
                <div class="mui-button-row">
                    <button type="button" class="mui-btn mui-btn-primary" onclick="CardInfo();">确认</button>&nbsp;&nbsp;
                    <button type="button" class="mui-btn mui-btn-danger" onclick="return false;">取消</button>
                </div>
            </div>
        </div>
        @*<div id="item3" class="mui-control-content">
            <form class="mui-input-group">
                <div class="mui-input-row">
                    <label>商户姓名</label>
                    <input type="text" class="mui-input-clear" placeholder="请输入商户姓名">
                </div>
                <div class="mui-input-row">
                    <label>生日</label>
                    <input type="date" class="mui-input-clear" placeholder="生日">
                </div>
                <div class="mui-input-row">
                    <label>联系方式</label>
                    <input type="text" class="mui-input-clear" placeholder="请输入联系方式">
                </div>
                <div class="mui-input-row">
                    <label>住址</label>
                    <input type="text" class="mui-input-clear" placeholder="请输入联系住址">
                </div>
                <div class="mui-button-row">
                    <button type="button" class="mui-btn mui-btn-primary" onclick="return false;">确认</button>&nbsp;&nbsp;
                    <button type="button" class="mui-btn mui-btn-danger" onclick="return false;">取消</button>
                </div>
            </form>
        </div>*@
        <div id="item4" class="mui-control-content">
            <div class="mui-content-padded">
                <h5>法人姓名</h5>
                <div class="mui-input-row">
                    <input type="text" id="LegalPerson" name="LegalPerson" class="mui-input-clear" placeholder="请输入法人姓名" value="@(Model == null?"":Model.BusinessLicenseInfo==null?"":Model.BusinessLicenseInfo.LegalPerson)">
                </div>
                <h5>证件有效期</h5>
                <div class="mui-input-row">
                    <input id="TermValidity" name="TermValidity" type="date" class="mui-input-clear" placeholder="证件有效期" value="@(Model == null?"":Model.BusinessLicenseInfo==null?"":Model.BusinessLicenseInfo.TermValidity.ToString("yyyy-MM-dd"))">
                </div>
                <h5>执照图片</h5>
                <div class="mui-input-row">
                    <div class="uploader uploader-default" id="uploadLicense">
                    </div>
                </div>
                <h5>预览</h5>
                <div class="mui-input-row">
                    @if (Model == null)
                    {
                        <img id="PreviewLicense" src='/images/zanwu.jpg' height="150" width="100%">
                    }
                    else
                    {
                        <img id="PreviewLicense" src="@(Model == null?"":Model.BusinessLicenseInfo==null?"/images/timg.jpg":Model.BusinessLicenseInfo.LicensePIc)" height="150" width="100%">
                    }
                </div>
                @*<h5>住址</h5>
                <div class="mui-input-row">
                    <input type="text" class="mui-input-clear" placeholder="请输入联系住址">
                </div>*@
                <div class="mui-button-row">
                    <button type="button" class="mui-btn mui-btn-primary" onclick="EditBusinessLicenseInfo()">确认</button>&nbsp;&nbsp;
                    <button type="button" class="mui-btn mui-btn-danger" onclick="return false;">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>
